<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //基础
    function acc(x,y){
      this.x=x
      this.y=y
      this.akk=function(){
        return "开心嗨嗨害"
      }
    }
    acc.prototype.ll=function(){
      return "拉拉"
    }
    var cao=new acc("cc",80)
    console.log(cao);
    console.log(cao.ll());
    //类函数
    class hh{
      constructor(x,y){
      this.x=x
      this.y=y
      }
      acc(){
        return "开心"
      }
    }
    var zhang=new hh("zz",90)
    console.log(zhang);
    console.log(zhang.acc);
  </script>
</body>
</html>